Inside Macintosh: QuickTime

Previous | Chapter Top | Chapter Contents | Next

Generating Pictures From Movies

The Movie Toolbox provides a set of functions that allow your application to create QuickDraw pictures from movies, tracks, and posters. This section discusses those functions.

You can use the GetMoviePict function to create a picture from a movie or its preview; you can use the GetTrackPict function to create a picture from a track. The GetMoviePosterPict function lets you create a picture that contains a movie's poster. If a movie or track has no spatial representation, the returned picture is empty--that is, the upper-left and lower-right coordinates are equal.

GetMoviePict

The GetMoviePict function creates a picture from the specified movie at the specified time. This function uses only those movie tracks that are currently enabled and would therefore be used in playback. Your application may call this function even if the movie is inactive.

pascal PicHandle GetMoviePict (Movie theMovie, TimeValue time);
theMovie
Specifies the movie for this operation. Your application obtains this movie identifier from such functions as NewMovie , NewMovieFromFile , and NewMovieFromHandle (described on NewMovie , NewMovieFromFile , and NewMovieFromHandle , respectively).
time
Specifies the movie image for the picture. The time parameter contains the time from which the image is taken.

DESCRIPTION

The GetMoviePict function returns a handle to the picture. Your application must dispose of this picture handle by calling QuickDraw's KillPicture routine. If the function could not create the picture, the returned handle is set to nil .

SPECIAL CONSIDERATIONS

You can use the GetMoviePict function to create a picture. If the movie contains compressed data, the picture created by this function may also contain compressed data that cannot be displayed without QuickTime.

ERROR CODES

invalidMovie

-2010

This movie is corrupted or invalid

invalidTime

-2015

This time value is invalid

Image Compression Manager errors Memory Manager errors

SEE ALSO

If you want to create a picture from a movie's preview, put the movie into preview mode by calling the SetMoviePreviewMode function (described on SetMoviePreviewMode ), and then call the GetMoviePict function.

GetMoviePosterPict

The GetMoviePosterPict function creates a picture that contains a movie's poster.

pascal PicHandle GetMoviePosterPict (Movie theMovie);
theMovie
Specifies the movie for this operation. Your application obtains this movie identifier from such functions as NewMovie , NewMovieFromFile , and NewMovieFromHandle (described on NewMovie , NewMovieFromFile , and NewMovieFromHandle , respectively).

DESCRIPTION

The GetMoviePosterPict function returns a handle to the picture. Your application must dispose of this picture handle by calling QuickDraw's KillPicture routine. If the function could not create the picture, the returned handle is set to nil .

SPECIAL CONSIDERATIONS

If you have not assigned a poster time for the movie, the Movie Toolbox creates the poster from the movie image that corresponds to a time value of 0.

ERROR CODES

invalidMovie

-2010

This movie is corrupted or invalid

Image Compression Manager errors Memory Manager errors

GetTrackPict

The GetTrackPict function creates a QuickDraw picture from the specified track at the specified time. This function is similar to the GetMoviePict function (described on GetMoviePict ), except that GetTrackPict uses only the specified track to create the picture.

pascal PicHandle GetTrackPict (Track theTrack, TimeValue time);
theTrack
Specifies the track for this operation. Your application obtains this track identifier from such Movie Toolbox functions as NewMovieTrack and GetMovieTrack (described on NewMovieTrack and GetMovieTrack , respectively).
time
Specifies the track image for the picture. The time parameter contains the time from which the image is taken.

DESCRIPTION

The GetTrackPict function returns a handle to the picture. Your application must dispose of this picture handle by calling QuickDraw's KillPicture routine. If the function could not create the picture, the returned handle is set to nil .

SPECIAL CONSIDERATIONS

You can specify a disabled track. If the track contains compressed data, the picture created by this function may also contain compressed data that cannot be displayed without QuickTime.

ERROR CODES

invalidTrack

-2009

This track is corrupted or invalid

invalidTime

-2015

This time value is invalid

Image Compression Manager errors Memory Manager errors


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next